/* bufPoolLib.h - buffer pool library header file*/

/* Copyright 2003-2005 Neotune Information Technology Co., Ltd. */

#ifndef __INCbufPoolLibh
#define __INCbufPoolLibh

#ifdef __cplusplus
extern "C" {
#endif


//#include "vxWorks.h"
//#include "neosTypes.h"
#include "neos_vx_win.h"
//#include "errno.h"

/* status codes */
#define S_bufPoolLib_INVALID_ID         (M_bufPoolLib | 1)
#define S_bufPoolLib_CREATE_ERROR        (M_bufPoolLib | 2)
#define S_bufPoolLib_DESTROY_ERROR        (M_bufPoolLib | 3)
#define S_bufPoolLib_INVALID_BUFSIZE    (M_bufPoolLib | 4)
#define S_bufPoolLib_INVALID_NBUFS        (M_bufPoolLib | 5)
#define S_bufPoolLib_ALLOC_ERROR         (M_bufPoolLib | 6)

/* type definitions */

typedef ulong_t BUF_POOL_ID;

#if defined(__STDC__) || defined(__cplusplus)
IMPORT BUF_POOL_ID bufPoolCreate( 
                            void *address,
                            ulong_t bufSize,
                            ulong_t nBufs,
                            BUFCFUNCPTR createFn,
                            BUFCFUNCPTR destroyFn,
                            ulong_t argVal);
IMPORT STATUS bufPoolDestroy( BUF_POOL_ID bufPool );
IMPORT void *bufPoolAlloc( BUF_POOL_ID bufPool );
IMPORT STATUS bufPoolFree( BUF_POOL_ID pool, void *elem );
IMPORT ulong_t bufPoolGetMemSize( ulong_t bufSize, ulong_t nBufs );
IMPORT ulong_t alignAddress( ulong_t value );
#else   /* __STDC__ */
BUF_POOL_ID bufPoolCreate();
IMPORT BUF_POOL_ID bufPoolCreate();
IMPORT STATUS bufPoolDestroy();
IMPORT void *bufPoolAlloc();
IMPORT STATUS bufPoolFree();
IMPORT ulong_t bufPoolGetMemSize( );
IMPORT ulong_t alignAddress( );
#endif  /* __STDC__ */

#ifdef __cplusplus
}
#endif

#endif
